package com.yanqu.road.server.cmd.banquet;

import com.yanqu.road.entity.banquet.cross.CrossBanquetRecord;
import com.yanqu.road.utils.YanQuMessageUtils;
import com.yanqu.road.pb.banquet.BanquetProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.logic.MessageHelper;
import com.yanqu.road.server.manager.banquet.CrossBanquetMgr;
import com.yanqu.road.server.pb.banquet.CrossBanquetPb;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

import java.util.List;

@Cmd(code = Protocol.C_CROSS_BANQUET_RECORD_LIST, desc = "跨服宴会記錄列表")
public class CrossBanquetRecordCmd extends CrossCommand {
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        List<CrossBanquetRecord> banquetRecordList = CrossBanquetMgr.getBanquetRecordList((int)serverId);
        BanquetProto.BanquetGetRecordResp.Builder respMsg = CrossBanquetPb.parseBanquetGetRecordResp(banquetRecordList);
		respMsg.setRet(0);
        YanQuMessage pbMsg = YanQuMessageUtils.buildMessage(Protocol.U_BANQUET_RECORD_LIST, respMsg);
        MessageHelper.sendPacket(serverId, packet.getPlayerId(), pbMsg);
    }

    @Override
    public void sendData() {

    }
}
